import pygame
import constants as c
import menu

screen = pygame.display.set_mode((c.WIDTH, c.HEIGHT))
pygame.display.set_caption('Plane War')
clock = pygame.time.Clock()


def main():
    menu.menu_display(screen)
    running = True
    while running:
        clock.tick(c.FPS)
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
        # 背景画卷向下滚动
        screen.fill(c.BLACK)
        screen.blit(c.background, (0, c.height))
        c.height += 2
        if c.height >= -168:
            c.height = -936
        pygame.display.update()
    pygame.quit()


if __name__ == '__main__':
    main()
